#! /usr/bin/env python
# -*- coding: utf-8 -*-

import OperationAdd
import OperationSub
import OperationMul
import OperationDiv
import OperationUndef


class OperationFactory(object):

    def __init__(self):
        self.operation = dict()
        self.operation["+"] = OperationAdd.OperationAdd()
        self.operation["-"] = OperationSub.OperationSub()
        self.operation["*"] = OperationMul.OperationMul()
        self.operation["/"] = OperationDiv.OperationDiv()

    def create_operation(self, ch):
        if self.operation.has_key(ch):
            op = self.operation.get(ch)
        else:
            op = OperationUndef.OperationUndef()
        return op
